package com.hxzy.springbootrocketproducer.controller;

import com.hxzy.springbootrocketproducer.dto.UserChargeDTO;
import com.hxzy.springbootrocketproducer.service.MQTXProducerService;
import org.apache.rocketmq.client.producer.TransactionSendResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 冲值
 */
@RestController
public class ChargeController {

    @Autowired
    private MQTXProducerService mqtxProducerService;

    @GetMapping("/charge")
    public TransactionSendResult charge(UserChargeDTO userCharge) {
        TransactionSendResult sendResult = mqtxProducerService.sendHalfMsg(userCharge);
        return sendResult;
    }


}